﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Schema;

namespace Model.Models
{
    /// <summary>
    /// 基础分页
    /// </summary>
    public class PageInfo
    {
        /// <summary>
        ///  pagenumber是从1开始的不是从零开始的
        /// </summary>
        public int Pagenumber { get; set; } = 1;
        /// <summary>
        ///  每页大小
        /// </summary>
        public int PageSize { get; set; } = 20;
    }


    /// <summary>
    /// 页面查询结果
    /// </summary>
    public class PageResult<T> where T : class
    {
        /// <summary>
        /// 数据集
        /// </summary>
        public List<T> Data { get; set; }

        /// <summary>
        /// 总记录数
        /// </summary>
       	public int Total { get; set; }


        public static PageResult<T> CreateInstance(List<T> datas, int total) => new PageResult<T>
        {
            Data = datas,
            Total = total
        };
    }
}
